package de.unimannheim.ki.algorithmn;

import de.unimannheim.ki.databaseentities.Musicuser;

public class Neighbour implements Comparable<Neighbour>{
	private double distance;
	private Musicuser user;
	
	
	public Neighbour(double distance, Musicuser user) {
		super();
		this.distance = distance;
		this.user = user;
	}


	@Override
	public int compareTo(Neighbour o) {
		if( o.distance > this.distance) {
			return 1;
		}else if ( o.distance == this.distance ){
			return 0;
		}else {
			return -1;
		}
	}


	public double getDistance() {
		return distance;
	}


	public void setDistance(double distance) {
		this.distance = distance;
	}


	public Musicuser getUser() {
		return user;
	}


	public void setUser(Musicuser user) {
		this.user = user;
	}
	
	public String toString() {
		return this.user.getFbid() + " - Distance: " + this.distance;
	}
		
	
	
	
}

